<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" th:href="@{/semantic/semantic.min.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <style>

    </style>
</head>

<body>

<!--        导航栏-->
<ul class="layui-nav" th:fragment="header(active)">
    <li th:class="${active == '主页' ? 'layui-nav-item layui-this' : 'layui-nav-item'}">
        <a th:href="@{/}">主页</a>
    </li>

    <li class="layui-nav-item" style="margin-right: 250px;margin-left: 200px;">
        <div class="ui icon input">
            <i class="search icon"></i>
            <input onkeydown="if(event.keyCode==13) {
                location.href = '/topic/search?word=' + this.value}" type="text" placeholder="回车进行搜索...">
        </div>
    </li>

    <li th:class="${active == '用户' ? 'layui-nav-item layui-this' : 'layui-nav-item'}" style="float: right">
        <a th:if="${session.user == null}" th:href="@{/login}">
            <i class="layui-icon layui-icon-username" style="font-size: 25px;"></i>
        </a>
        <div th:insert="component/avator.html::avator"></div>
    </li>
</ul>

</body>

<script th:src="@{/js/jquery.min.js}" crossorigin="anonymous"></script>
<script th:src="@{/semantic/semantic.min.js}"></script>
<script th:src="@{/layui/layui.js}"></script>
<script th:src="@{/js/vue.js}"></script>
<script th:src="@{/js/axios.js}"></script>
<script th:src="@{/js/my.js}"></script>
<script>
</script>

</html>